<#-- Copyright 2011 Canadensys -->
<#include "_inc/ftl/common.ftl">

<@assignTitle str=data.pageTitle/>
<#assign currentPage="name"/>

<#include "_inc/ftl/header.ftl">
<#include "_inc/ftl/menu.ftl">

<#if data.requiresDisambiguation == true >
<h1>${data.nameH1}</h1>
<#if data.isVernacularName == true>
	<#list data.disambiguationVernaculars as vernacular>
		<p class="${vernacular.status?lower_case}">
		    <@display str=("locale.vernacular_" + vernacular.status?lower_case + "_msg1")?eval args=[vernacular.vernacularid,vernacular.name,refBuilder(vernacular.link,vernacular.reference,vernacular.referenceShort,true,false,false),("locale.language_"+language)?eval]/>
		</p>								
		<p class="redirect_${vernacular.taxon.status?lower_case}">
                              <@display str=("locale.taxon_" + vernacular.taxon.status?lower_case + "_no_strong_msg1")?eval args=[vernacular.taxon.taxonId,vernacular.taxon.fullScientificName,prefixFrenchRank(("locale.rank_"+vernacular.taxon.rank?lower_case)?eval)?lower_case,refBuilder(vernacular.taxon.link,vernacular.taxon.reference,vernacular.taxon.referenceShort,false,true,false)]/>
		</p>
	</#list>
</#if>
<#if data.isTaxon == true>
	<#list data.disambiguationTaxons as taxon>
		<#if taxon.status?lower_case == "synonym">
			<p class="synonym">
			   <@display str=locale.taxon_synonym_msg1 args=[taxon.taxonId,taxon.fullScientificName,refBuilder(taxon.link,taxon.reference,taxon.referenceShort,true,false,false)]/>
			</p>
                              <#list taxon.parents as parent>
                                  <p class="redirect_${parent.status?lower_case}">
                                      <@display str=locale.taxon_accepted_no_strong_msg1 args=[parent.taxonId,parent.fullScientificName,prefixFrenchRank(("locale.rank_"+parent.rank?lower_case)?eval)?lower_case,refBuilder(parent.link,parent.reference,parent.referenceShort,false,true,false)]/>
                                  </p>
                              </#list>    
                          <#else>
                              <p class="accepted">
                                 <@display str=locale.taxon_accepted_msg1 args=[taxon.taxonId,taxon.fullScientificName,prefixFrenchRank(("locale.rank_"+taxon.rank?lower_case)?eval)?lower_case,refBuilder(taxon.link,taxon.reference,taxon.referenceShort,false,true,false)]/>
                              </p>
                          </#if>							
	</#list>
</#if>
<#else>
<#if data.isRedirect == true >
	<#if data.isSynonymWarning == true >
		<h4 class="warning round">
		    <@display str=locale.warning_synonym_msg args=[data.synonymWarningUrl,data.synonymWarningH1]/>			
		</h4>
	</#if>
	
	<#if data.isVernacularNameWarning == true >
		<h4 class="warning round">
		    <@display str=locale.warning_vernacular_msg args=[data.vernacularNameWarning,data.vernacularNameWarning?cap_first]/>			 
		</h4>
	</#if>
	
	<h1>${data.nameH1}</h1>
	<p class="accepted">
                          <@display str=locale.taxon_accepted_msg1 args=[data.id,data.name,prefixFrenchRank(("locale.rank_"+data.rank?lower_case)?eval)?lower_case,refBuilder(data.link,data.reference,data.referenceShort,false,true,false)]/>
	</p>			 
				   
	<@taxonContent />
	
<#else>
	<#-- no redirect ; display basic information for synonym or vernacular only -->
	<#if data.isSynonymWarning == true >
		<h1>${data.synonymWarningH1}</h1>
		<p class="synonym">
		    <@display str=locale.taxon_synonym_msg1 args=[data.synonymWarningId,data.synonymWarning,refBuilder(data.synonymWarningLink,data.synonymWarningReference,data.synonymWarningReferenceShort,true,false,false)]/>
		</p>	
	<#elseif data.isVernacularNameWarning == true >
		<h1>${data.vernacularNameWarning}</h1>
		<p class="${data.vernacularNameWarningStatus?lower_case}">
		    <@display str=("locale.vernacular_" + data.vernacularNameWarningStatus?lower_case + "_msg1")?eval args=[data.vernacularNameWarningId,data.vernacularNameWarning,refBuilder(data.vernacularNameWarningLink,data.vernacularNameWarningReference,data.vernacularNameWarningReferenceShort,true,false,false),("locale.language_"+data.vernacularNameWarningLanguage)?eval?lower_case]/>
		</p>
	</#if>  
	<p class="redirect_${data.status?lower_case}">
	    <@display str=("locale.taxon_" + data.status?lower_case + "_no_strong_msg1")?eval args=[data.id,data.name,prefixFrenchRank(("locale.rank_"+data.rank?lower_case)?eval)?lower_case,refBuilder(data.link data.reference data.referenceShort false true false)]/>
	</p>
</#if>
</#if>

<#include "_inc/ftl/footer.ftl">